{\rtf1\ansi\ansicpg936\cocoartf1504\cocoasubrtf820
{\fonttbl\f0\fnil\fcharset134 PingFangSC-Regular;\f1\fnil\fcharset0 Menlo-Regular;\f2\fnil\fcharset0 Menlo-Bold;
\f3\fnil\fcharset0 Menlo-Italic;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red221\green220\blue255;\red82\green0\blue103;
\red15\green112\blue3;\red0\green0\blue109;\red55\green113\blue112;\red103\green104\blue52;\red0\green0\blue254;
}
{\*\expandedcolortbl;;\csgenericrgb\c0\c0\c0;\csgenericrgb\c86667\c86275\c100000;\csgenericrgb\c32157\c0\c40392;
\csgenericrgb\c5882\c43922\c1176;\csgenericrgb\c0\c0\c42745;\csgenericrgb\c21569\c44314\c43922;\csgenericrgb\c40392\c40784\c20392;\csgenericrgb\c0\c0\c99608;
}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0

\f0\fs24 \cf0 \'ce\'a2\'d0\'c5\'b0\'f3\'b6\'a8\'bd\'d3\'bf\'da\'cb\'b5\'c3\'f7\
\
1.\'b8\'f9\'be\'ddloginname\'b7\'a2\'cb\'cd\'d1\'e9\'d6\'a4\'c2\'eb\
\cf2 \'c7\'eb\'c7\'f3Url\'a3\'ba
\f1 /api/user/phone/code
\f2\b \

\f0\b0 \'c0\'e0\'d0\'cd\'a3\'bahttp.post\
\'c7\'eb\'c7\'f3\'cc\'e5\'a3\'ba\{\
		loginame:\'a1\'b1loginname\'a1\'b1\
	\}\
\'b7\'b5\'bb\'d8\'d6\'b5\'cb\'b5\'c3\'f7\
\{code:0 msg:\'a1\'b1\'b7\'a2\'cb\'cd\'b3\'c9\'b9\'a6\'a1\'b1\}\
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
\cf2 \{code:1 msg:\'a1\'b1\'b2\'ce\'ca\'fd\'b4\'ed\'ce\'f3\'a1\'b1\}\
\{code:2 msg:\'a1\'b1\'d3\'c3\'bb\'a7\'b2\'bb\'b4\'e6\'d4\'da\'a1\'b1\}\
\{code:3 msg:\'a1\'b1\'d3\'c3\'bb\'a7\'ce\'b4\'b0\'f3\'b6\'a8\'ca\'d6\'bb\'fa\'a1\'b1\}\
\{code:4 msg:\'a1\'b1\'b7\'a2\'cb\'cd\'b6\'cc\'d0\'c5\'ca\'a7\'b0\'dc\'a1\'b1\}\
\{code:9 msg:\'a1\'b1\'b7\'fe\'ce\'f1\'c6\'f7\'b4\'ed\'ce\'f3\'a1\'b1\}\
\
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
\cf0 2.\'b8\'f9\'be\'ddloginname\'a3\'ac\'ca\'d6\'bb\'fa\'d1\'e9\'d6\'a4\'c2\'eb
\f1 \cb3 verification
\f0 \cb1 \'a3\'ac\'b0\'f3\'b6\'a8\'d3\'c3\'bb\'a7openid\
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
\cf2 \'c7\'eb\'c7\'f3Url\'a3\'ba
\f1 \cf2 /api/user/phone/code
\f2\b \

\f0\b0 \cf2 \'c0\'e0\'d0\'cd\'a3\'bahttp.post\
\'c7\'eb\'c7\'f3\'cc\'e5\'a3\'ba\{\
		loginame:\'a1\'b1loginname\'a1\'b1\'a3\'ac\
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0

\f1 \cf0 \cb3 		openid\cb1 :\cf2 'openidtest'\cf0 ,\uc0\u8232 
\f2\b \cf4 		
\f1\b0 \cf2 verification:'9297'
\f0 \cf2 \
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
\cf2 	\}\
\'b7\'b5\'bb\'d8\'d6\'b5\'cb\'b5\'c3\'f7\
\{code:0 msg:\'a1\'b1\'b7\'a2\'cb\'cd\'b3\'c9\'b9\'a6\'a1\'b1\}\
\{code:1 msg:\'a1\'b1\'b2\'ce\'ca\'fd\'b4\'ed\'ce\'f3\'a1\'b1\}\
\{code:2 msg:\'a1\'b1\'d3\'c3\'bb\'a7\'b2\'bb\'b4\'e6\'d4\'da\'a1\'b1\}\
\{code:3 msg:\'a1\'b1\'ce\'b4\'b2\'e9\'d5\'d2\'b5\'bd\'d3\'c3\'bb\'a7\'ca\'d6\'bb\'fa\'ba\'c5\'a1\'b1\}\
\{code:4 msg:\'a1\'b1\'d0\'a3\'d1\'e9\'ca\'d6\'bb\'fa\'d1\'e9\'d6\'a4\'c2\'eb\'ce\'b4\'cd\'a8\'b9\'fd\'a1\'b1\}\
\{code:9 msg:\'a1\'b1\'b7\'fe\'ce\'f1\'c6\'f7\'b4\'ed\'ce\'f3\'a1\'b1\}\
\
3.\'b8\'f9\'be\'ddloginname\'bb\'f1\'c8\'a1openid\
\'c7\'eb\'c7\'f3url\'a3\'ba
\f1 \cf2 /api/user/:loginanme/openid\

\f0 \cf2 \'c0\'e0\'d0\'cd\'a3\'ba
\f1 \cf2 http
\f0 \cf2 .get\
\'b7\'b5\'bb\'d8\'d6\'b5\'cb\'b5\'c3\'f7\
\{code:0 msg:\'a1\'b1\'b2\'e9\'d1\'af\'b3\'c9\'b9\'a6\'a1\'b1 ,data:\{loginname:\'a1\'b1loginname\'a1\'b1,openid:\'a1\'b1openid\'a1\'b1\}\}\
\{code:1 msg:\'a1\'b1\'d3\'c3\'bb\'a7\'b2\'bb\'b4\'e6\'d4\'da\'a1\'b1\}\
\{code:2 msg:\'a1\'b1\'d3\'c3\'bb\'a7\'ce\'b4\'b0\'f3\'b6\'a8\'ce\'a2\'d0\'c5\'a1\'b1\}\
\{code:9 msg:\'a1\'b1\'b7\'fe\'ce\'f1\'c6\'f7\'b4\'ed\'ce\'f3\'a1\'b1\}
\f1 \cf0 \

\f2\b \cf5 \
\
\
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
\cf6 var 
\f3\i\b0 \cf0 request 
\f1\i0 = 
\f3\i require
\f1\i0 (
\f2\b \cf5 'request'
\f1\b0 \cf0 );\uc0\u8232 
\f2\b \cf6 var 
\f1\b0 \cf7 serverUrl \cf0 = 
\f2\b \cf5 "http://localhost:8283"
\f1\b0 \cf0 ;\uc0\u8232 
\f2\b \cf6 var 
\f1\b0 \cf7 config \cf0 = 
\f3\i require
\f1\i0 (
\f2\b \cf5 '../config.json'
\f1\b0 \cf0 );\uc0\u8232 \u8232 describe(
\f2\b \cf5 'userAPI'
\f1\b0 \cf0 , 
\f2\b \cf6 function 
\f1\b0 \cf0 () \{\uc0\u8232     describe(
\f2\b \cf5 '#sendPhoneCode'
\f1\b0 \cf0 , 
\f2\b \cf6 function 
\f1\b0 \cf0 () \{\uc0\u8232         it(
\f2\b \cf5 'should return false'
\f1\b0 \cf0 , 
\f2\b \cf6 function 
\f1\b0 \cf0 (done) \{\uc0\u8232             
\f3\i request
\f1\i0 .
\f2\b \cf4 post
\f1\b0 \cf0 (\{\uc0\u8232                 
\f2\b \cf4 url
\f1\b0 \cf0 : \cf7 serverUrl \cf0 + 
\f2\b \cf5 "/api/user/phone/code"
\f1\b0 \cf0 ,\uc0\u8232                 
\f2\b \cf4 form
\f1\b0 \cf0 : \{\uc0\u8232                     
\f2\b \cf4 loginname
\f1\b0 \cf0 : 
\f2\b \cf5 'zzgghh'
\f1\b0 \cf0 ,\uc0\u8232                 \}\u8232             \}, 
\f2\b \cf6 function 
\f1\b0 \cf0 (error, respose, body) \{\uc0\u8232                 
\f2\b \cf6 if 
\f1\b0 \cf0 (error) \{\uc0\u8232                     done(error);\u8232                 \} 
\f2\b \cf6 else 
\f1\b0 \cf0 \{\uc0\u8232                     
\f2\b \cf6 var 
\f1\b0 \cf7 data \cf0 = 
\f2\b \cf4 JSON
\f1\b0 \cf0 .\cf8 parse\cf0 (body);\uc0\u8232                     
\f2\b \cf4 console
\f1\b0 \cf0 .\cf8 log\cf0 (\cf7 data\cf0 );\uc0\u8232                     
\f2\b \cf6 if 
\f1\b0 \cf0 (\cf7 data\cf0 .
\f2\b \cf4 code 
\f1\b0 \cf0 == \cf9 0 \cf0 ) \{\uc0\u8232                         done();\u8232                     \} 
\f2\b \cf6 else 
\f1\b0 \cf0 \{\uc0\u8232                         done(
\f2\b \cf5 '
\f0 \'b7\'b5\'bb\'d8\'d6\'b5\'b4\'ed\'ce\'f3\'a3\'a1
\f2 '
\f1\b0 \cf0 );\uc0\u8232                     \}\u8232                 \}\u8232             \});\u8232         \});\u8232     \});\u8232 \});\u8232 \u8232 describe(
\f2\b \cf5 'userAPI'
\f1\b0 \cf0 , 
\f2\b \cf6 function 
\f1\b0 \cf0 () \{\uc0\u8232     describe(
\f2\b \cf5 '#bindingOpenId'
\f1\b0 \cf0 , 
\f2\b \cf6 function 
\f1\b0 \cf0 () \{\uc0\u8232         it(
\f2\b \cf5 'should return false'
\f1\b0 \cf0 , 
\f2\b \cf6 function 
\f1\b0 \cf0 (done) \{\uc0\u8232             
\f3\i request
\f1\i0 .
\f2\b \cf4 post
\f1\b0 \cf0 (\{\uc0\u8232                 
\f2\b \cf4 url
\f1\b0 \cf0 : \cf7 serverUrl \cf0 + 
\f2\b \cf5 "/api/user/chat/binding"
\f1\b0 \cf0 ,\uc0\u8232                 
\f2\b \cf4 form
\f1\b0 \cf0 : \{\uc0\u8232                     
\f2\b \cf4 loginname
\f1\b0 \cf0 : 
\f2\b \cf5 '66666'
\f1\b0 \cf0 ,\uc0\u8232                     
\f2\b \cf4 openid
\f1\b0 \cf0 :
\f2\b \cf5 'openidtest'
\f1\b0 \cf0 ,\uc0\u8232                     
\f2\b \cf4 verification
\f1\b0 \cf0 :
\f2\b \cf5 '9297'\uc0\u8232                 
\f1\b0 \cf0 \}\uc0\u8232             \}, 
\f2\b \cf6 function 
\f1\b0 \cf0 (error, respose, body) \{\uc0\u8232                 
\f2\b \cf6 if 
\f1\b0 \cf0 (error) \{\uc0\u8232                     done(error);\u8232                 \} 
\f2\b \cf6 else 
\f1\b0 \cf0 \{\uc0\u8232                     
\f2\b \cf6 var 
\f1\b0 \cf7 data \cf0 = 
\f2\b \cf4 JSON
\f1\b0 \cf0 .\cf8 parse\cf0 (body);\uc0\u8232                     
\f2\b \cf4 console
\f1\b0 \cf0 .\cf8 log\cf0 (\cf7 data\cf0 );\uc0\u8232                     
\f2\b \cf6 if 
\f1\b0 \cf0 (\cf7 data\cf0 .
\f2\b \cf4 code 
\f1\b0 \cf0 == \cf9 0 \cf0 ) \{\uc0\u8232                         done();\u8232                     \} 
\f2\b \cf6 else 
\f1\b0 \cf0 \{\uc0\u8232                         done(
\f2\b \cf5 '
\f0 \'b7\'b5\'bb\'d8\'d6\'b5\'b4\'ed\'ce\'f3\'a3\'a1
\f2 '
\f1\b0 \cf0 );\uc0\u8232                     \}\u8232                 \}\u8232             \});\u8232         \});\u8232     \});\u8232 \});\u8232 \u8232 describe(
\f2\b \cf5 'userAPI'
\f1\b0 \cf0 , 
\f2\b \cf6 function 
\f1\b0 \cf0 () \{\uc0\u8232     describe(
\f2\b \cf5 '#getOpenIdByLoginName'
\f1\b0 \cf0 , 
\f2\b \cf6 function 
\f1\b0 \cf0 () \{\uc0\u8232         it.only(
\f2\b \cf5 'should return false'
\f1\b0 \cf0 , 
\f2\b \cf6 function 
\f1\b0 \cf0 (done) \{\uc0\u8232             
\f3\i request
\f1\i0 (\cf7 serverUrl \cf0 + 
\f2\b \cf5 "/api/user/zzgghh/openid"\uc0\u8232             
\f1\b0 \cf0 , 
\f2\b \cf6 function 
\f1\b0 \cf0 (error, respose, body) \{\uc0\u8232                 
\f2\b \cf6 if 
\f1\b0 \cf0 (error) \{\uc0\u8232                     done(error);\u8232                 \} 
\f2\b \cf6 else 
\f1\b0 \cf0 \{\uc0\u8232                     
\f2\b \cf6 var 
\f1\b0 \cf7 data \cf0 = 
\f2\b \cf4 JSON
\f1\b0 \cf0 .\cf8 parse\cf0 (body);\uc0\u8232                     
\f2\b \cf4 console
\f1\b0 \cf0 .\cf8 log\cf0 (\cf7 data\cf0 );\uc0\u8232                     
\f2\b \cf6 if 
\f1\b0 \cf0 (\cf7 data\cf0 .
\f2\b \cf4 code 
\f1\b0 \cf0 == \cf9 0 \cf0 ) \{\uc0\u8232                         done();\u8232                     \} 
\f2\b \cf6 else 
\f1\b0 \cf0 \{\uc0\u8232                         done(
\f2\b \cf5 '
\f0 \'b7\'b5\'bb\'d8\'d6\'b5\'b4\'ed\'ce\'f3\'a3\'a1
\f2 '
\f1\b0 \cf0 );\uc0\u8232                     \}\u8232                 \}\u8232             \});\u8232         \});\u8232     \});\u8232 \});\
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0

\f2\b \cf5 \
}